package com.eastfair.auth.controller;

import com.eastfair.annotation.annotation.log.SysLog;
import com.eastfair.auth.dto.OrganizationDTO;
import com.eastfair.auth.service.OrganizationService;
import com.eastfair.core.base.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 公司controlelr
 *
 * </p>
 *
 * @author ligang
 * @date 2021-07-16
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/initOrganization")
@Api(value = "InitOrganizationController", tags = "初始化组织角色")
public class InitOrganizationController {

    @Autowired
    OrganizationService organizationService;

    /**
     * 初始化组织角色数据
     * @return
     */
    @ApiOperation(value = "初始化组织角色数据", notes = "初始化组织角色数据")
    @GetMapping("/initOrgAndRole")
    @SysLog("初始化组织角色数据")
    public R initOrgAndRole(OrganizationDTO organizationDTO) {
        organizationService.initOrgAndRole(organizationDTO);
        return R.success();
    }


}



